package top.zywork.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import top.zywork.annotation.ExposeClass;
import top.zywork.service.GoodsOrderService;

/**
 * 商城订单自动确认作业<br/>
 *
 * 创建于2020-02-27<br/>
 *
 * @author 王振宇
 * @version 1.0
 */
@ExposeClass(type = "job")
@Slf4j
public class GoodsOrderAutoConfirmJob implements Job {

    private GoodsOrderService goodsOrderService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("begin to execute GoodsOrderAutoConfirmJob......");
        goodsOrderService.autoConfirmOrders();
        log.info("executed GoodsOrderAutoConfirmJob......");
    }

    @Autowired
    public void setGoodsOrderService(GoodsOrderService goodsOrderService) {
        this.goodsOrderService = goodsOrderService;
    }
}
